package com.epam.kulibaba.components.catalog.linkSpecialOffers;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.PageFactory;
import org.testng.Reporter;

import com.epam.kulibaba.components.Component;

public class LinkToSpecialOffers extends Component {
	public static final String LINKTOSPECIALOFFERS = ".//div[@class='link']/a";
	@FindBy(xpath = LinkToSpecialOffers.LINKTOSPECIALOFFERS)
	private WebElement linkBarPrice;

	public WebElement getLinkToSpecialOffers() {
		return linkBarPrice;
	}
	
	public static void goToSpecialOffers(LinkToSpecialOffers linkBarPrice){
		Reporter.log("Go to special price from products catalog page");
		linkBarPrice.getLinkToSpecialOffers().click();
	}
	
	public LinkToSpecialOffers getLinksBarToSpecialOffers(WebDriver driver) {
		LinkToSpecialOffers catalogPages = PageFactory.initElements(driver,
				LinkToSpecialOffers.class);
		return catalogPages;
	}
}
